package org.chen.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.chen.common.SignUp;
import org.chen.result.BaseResponse;
import org.chen.result.CommonResponse;
import org.chen.result.ResultBody;
import org.chen.service.SignUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sign")
public class SignUpController {
    @Autowired
    private SignUpService signUpService;

    @PostMapping("/signUp")
    private ResultBody<CommonResponse> signUp(@RequestBody SignUp signUp){
        return ResultBody.success(signUpService.signUp(signUp));
    }

    @GetMapping("/getByUserId")
    private ResultBody<BaseResponse<SignUp>> getByUserId(@RequestParam("userId") String userId){
        return ResultBody.success(signUpService.getByUserId(userId));
    }
}
